package com.mccken.thread;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @program: mccken-collect
 * @description:
 * @author: mccken
 * @create: 2024-03-20 22:09
 **/
public class MyThreadPoolExecutor extends ThreadPoolExecutor {

	private String name;

	public MyThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory, String name) {
		super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, threadFactory);
		this.name = name;
	}

	public String getName() {
		return name;
	}


	@Override
	public void execute(Runnable command) {
		System.out.println("before execute");
		super.execute(command);
		System.out.println("end execute");
	}
}
